package houtai.service;

import houtai.mapper.DashBoardMapper;
import houtai.vo.DashBoardVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DashBoardService {
    @Autowired
    private DashBoardMapper dashBoardMapper;

    public DashBoardVo queryDashBoard() {
        DashBoardVo dashBoardVo = new DashBoardVo();
        dashBoardVo.setCumulativeUsers(dashBoardMapper.queryCumulativeUsers());
        dashBoardVo.setActivePassMonth(dashBoardMapper.queryActivePassMonth());
        dashBoardVo.setActivePassWeek(dashBoardMapper.queryActivePassWeek());
        dashBoardVo.setNewUsersToday(dashBoardMapper.queryNewUsersToday());
        dashBoardVo.setLoginTimesToday(dashBoardMapper.queryLoginTimesToday());
        dashBoardVo.setActiveUsersToday(dashBoardMapper.queryActiveUsersToday());
        dashBoardVo.setNewUsersTodayRate(dashBoardMapper.queryNewUsersTodayRate());
        dashBoardVo.setLoginTimesTodayRate(dashBoardMapper.queryLoginTimesTodayRate());
        dashBoardVo.setActiveUsersTodayRate(dashBoardMapper.queryActiveUsersTodayRate());
        return dashBoardVo;
    }
}
